#include<iostream>

using namespace std;

int main(){
	int n;
	cin>>n;
	int jia=0,yi=0;
	while(n--){
		int jia_han,jia_hua,yi_han,yi_hua;
		cin>>jia_han>>jia_hua>>yi_han>>yi_hua;
		int jia_temp,yi_temp;
		jia_temp=jia_han==(jia_hua+yi_hua)?1:0;
		yi_temp=yi_han==(jia_hua+yi_hua)?1:0;
		if(jia_temp>yi_temp) yi++;
		else if(jia_temp<yi_temp) jia++;
		else continue;

	}
	cout<<jia<<" "<<yi<<endl;
}